package chapter02;

import java.util.Scanner;

public class Training09 {
    public static void main(String[] args) {
        Scanner ren = new Scanner(System.in);

        System.out.println("请输入班级人数");
        int a,e,r,t,f;
        a = ren.nextInt();
        double b,d;
        d =0;
        e=r=t=f= 0;
        double [] c = new double[a];
        for (int i = 0; i < a; i++) {
            System.out.print("请输入学号是"+(i+1)+"学生的成绩: ");

            b = ren.nextDouble();
            c[i]=b;
            if (c[i]>=80){
                e = e+1;
            }else if (c[i]>=70){
                r = r+1;
            }else if (c[i]>=60){
                t = t+1;
            }else {
                f = f+1;
            }
            d = d+c[i];
        }
        System.out.println("全班平均成绩为" + d/a);
        System.out.println("成绩大于80分："+e);
        System.out.println("成绩大于70分："+r);
        System.out.println("成绩大于60分："+t);
        System.out.println("成绩不及格人数："+f);
    }
}
